package com.web.music.model;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.*;

// TODO [done]
// You have to make this class a persistent entity
@Entity
public class Genre implements PersistentEntity {

	@Id 
	@Column (name="GENRE_ID" , nullable = false) 
	private Long id;

	private String name;

	@ManyToMany(mappedBy="genres")	
	private List<Artist> artists = new ArrayList<Artist>();
	
	@ManyToMany(mappedBy="genres")	
	private List<Album> albums = new ArrayList<Album>();

	public String getName(){
		return name;
	}

	public void setName(String name ){
		this.name = name;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public List<Artist> getArtists() {
		return artists;
	}

	public void setArtists(List<Artist> artists) {
		this.artists = artists;
	}	
	public List<Album> getAlbums() {
		return albums;
	}

	public void setAlbums(List<Album> albums) {
		this.albums = albums;
	}	
}
